<template>
  <a-modal
    :title="`角色${title}`"
    :width="640"
    destroyOnClose
    :visible="visible"
    :confirmLoading="loading"
    @ok="handleSubmit"
    @cancel="visible=!visible"
  >
    <a-spin :spinning="loading">
      <a-form :form="form">
        <a-form-item
          label="角色名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          <a-input v-decorator="['roleName', {initialValue: editForm.roleName,rules: rules.roleName}]"/>
        </a-form-item>

      </a-form>
    </a-spin>
  </a-modal>
</template>

<script>

  const rules = {
    roleName: [
      { required: true, message: '角色名不能空！' },
    ],
  }

  import saveMixins from '../../../../common/mixins/saveMixins'

  import {save} from '../../../../api/base/role'

  export default {
    name: 'save',
    data() {
      return {
        rules: rules,
        roles:[]
      }
    },
    mixins: [saveMixins],

    methods:{
      commit(values){
        return save(values);
      },
    }
  }
</script>

<style scoped>

</style>